<%@ include file="../common/base.jsp" %>
<%@ page contentType= "text/html;charset=utf-8" %>
<%@ page language="java" import="com.octopus.optiworks.model.Product"%>
<%@ page language="java" import="com.octopus.optiworks.service.ConfigurationService"%>
<% Product product = (Product)request.getAttribute("product"); %>
<% boolean isAutoOperatorDate = ConfigurationService.getInstance().isAutoOpeartorDate() ; %>

<% if(product.getStep120_1Datas().size() > 0 || product.getStep120_2Datas().size() > 0 ){ %>
<c:if test="${not empty step120_1}">
<input type="hidden" name="className" value="com.octopus.optiworks.model.Step120_1Data">
<input type="hidden" name="step" value="step120_1">

<table width="100%" rules="all">
	<tr>
		<td align="left" width="100%" colspan="4">
			<strong style="color:#A0A0FF">Step 120 循环II (MPI: )</strong>
		</td>
	</tr>
	<tr bgcolor="#F0F0FF">
		<c:forEach var="step120_1Data" varStatus="status" items="${product.step120_1Datas}">
		<input type="hidden" name="id" value="<c:out value="${step120_1Data.id}" />">
		<input type="hidden" name="product" value="<c:out value="${step120_1Data.product.id}" />">
		<td align="left" width="20%">
			进循环时间:
			<!--  
			<input type="text" name="cycleEnterTime" size="3" value="<c:out value="${step120_1Data.cycleEnterTime}" />">
			-->
			<input type="text" name="cycleEnterTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<c:out value="${step120_1Data.cycleEnterTime}" />">
		</td>
		<td align="left" width="30%">
			Operator/Date:<br>
			<% if(isAutoOperatorDate){ %>
			<c:out value="${step120_1Data.operator}" />
			/
			<fmt:formatDate  value="${step120_1Data.date}" pattern="yyyy-MM-dd HH:mm"/>
			<% }else{ %>
			<select name="operator">
				<c:forEach var="user" items="${users}">
				<option value="<c:out value="${user.username}" />" 
				<c:if test="${(null==step120_1Data.operator && user.username==currentUser.username) || (null!=step120_1Data.operator && user.username==step120_1Data.operator)}">
				selected="selected"
				</c:if>
				><c:out value="${user.username}" /></option>
				</c:forEach>
				</select>
				/
				<input type="text" name="date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step120_1Data.date}" pattern="yyyy-MM-dd HH:mm"/>">
			<% } %>
		</td>
		</c:forEach>
		<c:forEach var="step120_2Data" varStatus="status" items="${product.step120_2Datas}">
		<td align="left" width="20%">
			出循环时间
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step120_2 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step120_2">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
			:
			<c:out value="${step120_2Data.cycleLeaveTime}" />
		</td>
		<td align="left" width="30%">
			Operator/Date:
			<c:out value="${step120_2Data.operator}" />
			/
			<fmt:formatDate  value="${step120_2Data.date}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
	</tr>
</table>
</c:if>


<c:if test="${not empty step120_2}">
<input type="hidden" name="className" value="com.octopus.optiworks.model.Step120_2Data">
<input type="hidden" name="step" value="step120_2">

<table width="100%" rules="all">
	<tr>
		<td align="left" width="100%" colspan="4">
			<strong style="color:#A0A0FF">Step 120 循环II (MPI: )</strong>
		</td>
	</tr>
	<tr bgcolor="#F0F0FF">
		<c:forEach var="step120_1Data" varStatus="status" items="${product.step120_1Datas}">
		<td align="left" width="20%">
			进循环时间
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step120_1 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step120_1">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
			:
			<c:out value="${step120_1Data.cycleEnterTime}" />
		</td>
		<td align="left" width="30%">
			Operator/Date:
			<c:out value="${step120_1Data.operator}" />
			/
			<fmt:formatDate  value="${step120_1Data.date}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
		<c:forEach var="step120_2Data" varStatus="status" items="${product.step120_2Datas}">
		<input type="hidden" name="id" value="<c:out value="${step120_2Data.id}" />">
		<input type="hidden" name="product" value="<c:out value="${step120_2Data.product.id}" />">
		<td align="left" width="20%">
			出循环时间:
			<!--  
			<input type="text" name="cycleLeaveTime" size="3" value="<c:out value="${step120_2Data.cycleLeaveTime}" />">
			-->
			<input type="text" name="cycleLeaveTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<c:out value="${step120_2Data.cycleLeaveTime}" />">
		</td>
		<td align="left" width="30%">
			Operator/Date:<br>
			<% if(isAutoOperatorDate){ %>
			<c:out value="${step120_2Data.operator}" />
			/
			<fmt:formatDate  value="${step120_2Data.date}" pattern="yyyy-MM-dd HH:mm"/>
			<% }else{ %>
			<select name="operator">
				<c:forEach var="user" items="${users}">
				<option value="<c:out value="${user.username}" />" 
				<c:if test="${(null==step120_2Data.operator && user.username==currentUser.username) || (null!=step120_2Data.operator && user.username==step120_2Data.operator)}">
				selected="selected"
				</c:if>
				><c:out value="${user.username}" /></option>
				</c:forEach>
				</select>
				/
				<input type="text" name="date" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" class="Wdate" style="width:130px" value="<fmt:formatDate  value="${step120_2Data.date}" pattern="yyyy-MM-dd HH:mm"/>">
			<% } %>
		</td>
		</c:forEach>
	</tr>
</table>
</c:if>



<c:if test="${(empty step120_1) && (empty step120_2)}">
<table width="100%" rules="all">
	<tr>
		<td align="left" width="100%" colspan="4">
			<strong>Step 120 循环II (MPI: )</strong>
		</td>
	</tr>
	<tr>
		<c:forEach var="step120_1Data" varStatus="status" items="${product.step120_1Datas}">
		<td align="left" width="20%">
			进循环时间
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step120_1 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step120_1">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
			:
			<c:out value="${step120_1Data.cycleEnterTime}" />
		</td>
		<td align="left" width="30%">
			Operator/Date:
			<c:out value="${step120_1Data.operator}" />
			/
			<fmt:formatDate  value="${step120_1Data.date}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
		<c:forEach var="step120_2Data" varStatus="status" items="${product.step120_2Datas}">
		<td align="left" width="20%">
			出循环时间
			<shiro:hasPermission name="process:edit">
			<c:if test="${empty step120_2 && empty View}">
			&nbsp;&nbsp;
			<a href="./sedit.o?productId=<c:out value='${product.id}'/>&step=step120_2">
				<fmt:message key="Edit" />
			</a>
			</c:if>
			</shiro:hasPermission>
			:
			<c:out value="${step120_2Data.cycleLeaveTime}" />
		</td>
		<td align="left" width="30%">
			Operator/Date:
			<c:out value="${step120_2Data.operator}" />
			/
			<fmt:formatDate  value="${step120_2Data.date}" pattern="yyyy-MM-dd HH:mm"/>
		</td>
		</c:forEach>
	</tr>
</table>
</c:if>

<% }%>

